@import '../../../app/mixins.css';

@keyframes show {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.9);
    visibility: hidden;
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
  }
}

@keyframes hide {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
  }

  to {
    opacity: 0;
    transform: translateY(-50%) scale(0.9);
    visibility: hidden;
  }
}

@keyframes showMask {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hideMask {
  from { opacity: 1; }
  to { opacity: 0; }
}

.mask {
  animation-duration: var(--animation-speed-fast);
  animation-timing-function: linear;
  animation-direction: normal;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  align-items: center;
  background-color: var(--color-dialog-bg);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  opacity: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: var(--dialog-index);

  &.show {
    animation-name: showMask;

    & .wrapper {
      animation-name: show;
    }
  }

  &.hide {
    animation-name: hideMask;

    & .wrapper {
      animation-name: hide;
      opacity: 1;
      transform: translateY(0) scale(1);
      visibility: visible;
    }
  }
}

.wrapper {
  animation-delay: var(--animation-delay-standard);
  animation-direction: alternate;
  animation-duration: var(--animation-speed-fastest);
  animation-fill-mode: both;
  animation-iteration-count: 1;
  animation-timing-function: linear;
  background-color: var(--color-white);
  border-radius: var(--border-radius-box);
  border: solid 1px var(--dark-border-color);
  box-shadow: var(--box-shadow-dialog);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  max-width: var(--dialog-box-width);
  opacity: 0;
  padding: 40px;
  position: relative;
  transform: translateY(-50%) scale(0.9);
  visibility: hidden;
  width: 100%;
}

.title {
  @mixin headingLarge;

  color: var(--color-maastricht-blue);
  margin: 20px 0 0;
  text-align: center;
}

.description {
  @mixin contentLargest;

  color: var(--color-slate-gray);
  max-width: 460px;
  margin: 10px auto;
  text-align: center;

  & *:not(a) {
    color: inherit;
    font-size: inherit;
    margin: 0;
  }
}

.optionsHolder {
  display: flex;
  margin: 30px auto 0;
  width: 100%;

  & > * {
    margin: 0 10px;

    &:first-child {
      margin-left: 0;
    }

    &:last-child {
      margin-right: 0;
    }
  }

  &.left {
    justify-content: flex-start;
  }

  &.right {
    justify-content: flex-end;
  }

  &.center {
    justify-content: center;
    max-width: 470px;

    & > * {
      flex-basis: 100%;
      max-width: var(--footer-button-width);
    }
  }
}

.closeBtn {
  align-items: center;
  border: 1px solid var(--color-ghost);
  border-radius: var(--border-radius-box);
  box-sizing: border-box;
  color: var(--color-ghost);
  cursor: pointer;
  display: flex;
  height: 32px;
  justify-content: center;
  position: absolute;
  right: 30px;
  top: 30px;
  width: 32px;

  &::before,
  &::after {
    background-color: currentColor;
    color: inherit;
    content: '';
    height: 13px;
    position: absolute;
    width: 1px;
  }

  &::before {
    transform: rotate(45deg);
  }

  &::after {
    transform: rotate(-45deg);
  }
}
